import { ConfigManager } from "../../../com/gengine/resource/ConfigManager";
import { TVipDesc } from "../../../Message/Db/Tables/TVipDesc";
import { StringHelper } from "../../../com/gengine/utils/StringHelper";
type int = number;
//class VipDescConfig
    
    export  class VipDescConfig
    {
        constructor()
        {
            
            this._map = new Map<any, any> /* flash.utils.Dictionary */();
            if (VipDescConfig._instance != null) 
            {
                throw new Error("VipDescConfig 单例");
            }
            this.init();
            return;
        }

        /* internal  */init(): void
        {
            var loc1=ConfigManager.instance.getJSONByFileName("t_vip_desc.json");
            this.write(loc1);
            return;
        }

        /* internal  */write(arg1: Object): void
        {
            var loc1=null;
            var loc2=null;
            var loc3=0;
            var loc4=arg1;
            for(loc2 of loc4) 
            {
                loc1 = new TVipDesc();
                loc1.vipCardType = loc2.vipCardType;
                loc1.vipCardDescTitle = StringHelper.getString(loc2.vipCardDescTitle);
                loc1.vipCardDesc = StringHelper.getString(loc2.vipCardDesc);
                this._map[loc1.vipCardType] = loc1;
            }
            return;
        }

        public getVipDescByType(arg1: int): string
        {
            return (this._map[arg1] as TVipDesc).vipCardDesc;
        }

        public getVipFullDescByType(arg1: int): string
        {
            var loc1="";
            var loc2=this._map[arg1] as TVipDesc;
            loc1 = loc1 + loc2.vipCardDescTitle;
            loc1 = loc1 + loc2.vipCardDesc;
            return loc1;
        }

        public static get instance(): VipDescConfig
        {
            if (VipDescConfig._instance == null) 
            {
                VipDescConfig._instance = new VipDescConfig();
            }
            return VipDescConfig._instance;
        }

        /* internal */ /* var */_map: Map<any, any> /* flash.utils.Dictionary */;

        /* internal */ static /* var */_instance: VipDescConfig;
    }
